/*!
   \file

   © 2011 Mark W. Gabby II

   This file is part of the Avion engine.

   The Avion engine is free software: you can redistribute it and/or modify it under the terms of
   the GNU General Public License as published by the Free Software Foundation, either version 3 of
   the License, or (at your option) any later version.

   The Avion engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
   without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
   the GNU General Public License for more details.

   You should have received a copy of the GNU General Public License along with the Avion Engine.
   If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "Components/gcBase.hpp"

#include "Util/Color.hpp"

/*!
   \brief
      A particle system.
*/
class gcParticles : public gcBase
{
public:
   gcParticles( Entity * Owner );
   ~gcParticles();

   bool Draw();

   void Replay();

   void Init( const bool Looping, const uint32_t NumParticles, const float TimeToLiveSeconds,
              const float Velocity, const float ParticleSize, const float FinalSizeMultiplier, const float EmissionRadius,
              const char * const TextureName, const Color<> & StartColor, const Color<> & EndColor );

   bool ParticlesActive();

private:
   friend class Graphics;
   static float sTimeStep;

   uint32_t RegisterConcreteClassWithSystem();

   bool looping;
   bool hasPlayed;

   uint32_t numParticles;
   float ttlSeconds;
   float velocity;
   float particleSize;
   float emissionRadius;
   float finalSizeMultiplier;
   uint32_t textureID;
   Color<> startColor;
   Color<> endColor;

   int particleGroupHandle;
};
